package com.zzh.tools;


/**
 * @author zhangzhihao
 * @email zhangzhihao@gongjiangren.net
 * @date 2020-07-02
 * @desc
 */
public class ToolClickDelayedUtils {

    // 两次点击按钮之间的点击间隔不能少于1000毫秒
    private static long lastClickTime;

    public static boolean isFastClick() {
        boolean flag = true;
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= ToolConstantUtils.CLICK_TIME_GAP) {
            flag = false;
            lastClickTime = curClickTime;
        }
        return flag;
    }

    public static boolean isFastClick(long fastTime) {
        boolean flag = true;
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= fastTime) {
            flag = false;
            lastClickTime = curClickTime;
        }
        return flag;
    }



}
